<?php

/*
 *------------------------------------------------------------------------------
 * Project Name  : e-Synergy Library System
 *         Code  : ESN-LBS
 *
 * Created By    : Sira.o
 *         Date  : 2009/09/29
 *
 * $Id$
 *------------------------------------------------------------------------------
 *    copyright: e-Synergy Co., Ltd.
 *==============================================================================
 */

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Language extends CI_Language
{	
	function set_lang($locale)
	{
		$support_lang = array('en', 'th');
		
		$locale = substr($locale, 0, 2);				
		$lang   = in_array($locale, $support_lang) ? $locale : 'en';

		$this->load('common', $lang);
		$this->load('screen', $lang);
	}
	
	/**
	 * overide CI_Language::line
	 * @see system/libraries/CI_Language#line($line)
	 */
	function line($word = '')
	{
		if (is_empty($word) OR ! isset($this->language[$word]))
		{
			$translate = $word;
		}
		else
		{
			$translate = $this->language[$word];
		}

		return $translate;
	}
	
}

// END MY_Language class

/* End of file MY_Language.php */
/* Location: application/libraries/MY_Language.php */